﻿//
//
/////////////////////////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FreeSpace.Core;
using FreeSpace.Logic;
using FreeSpaceLibrary;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

/////////////////////////////////////////////////////////////////////////////
namespace FreeSpace.Scenes
{
    /////////////////////////////////////////////////////////////////////////
    public class BackgroundSubScene : ISubScene
    {
        private AsteroidFieldControl _asteroidFields;
        private SpriteBatch _sprite;

        public BackgroundSubScene(SpriteBatch sprite)
        {
            _sprite = sprite;
            _asteroidFields = ObjectsContainer.Instance.GetObject(ObjectType.AsteroidFields) as AsteroidFieldControl;
        }

        /////////////////////////////////////////////////////////////////////
        public void Update(GameTime gameTime, KeyboardState keyboardState)
        {
            _asteroidFields.CallUpdateEvent(gameTime);
        }

        /////////////////////////////////////////////////////////////////////
        public void Draw()
        {
            _sprite.Begin();
            _sprite.Draw(ContentLoader.ContentTextures[TextureEnum.BackgroundLevel1], Vector2.Zero, Color.White);
            _sprite.End();

            _asteroidFields.CallDrawEvent();
        }
    }
/////////////////////////////////////////////////////////////////////////////
}//FreeSpace.Scenes
